<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="王超凡">
    
    <title></title>
    <style>
        body {
            margin: 0;
        }
        
        .kuang {
            margin: 100px auto;
            width: 250px;
            height: 350px;
            border: 4px solid pink;
        }
        .datu{
            width: 154px;
            height: 154px;
        }
        .datu img {
            position: absolute;
            display: none;
        }
        .datu img:nth-child(1){
            display: block;
        }
        .xiaotu img{
            float: left;
            padding: 5px;
        }
        
    
    </style>
</head>

<body>
    <div class="kuang">
        <div class="datu">
            <img src="./img/big_1.jpg" alt="">
            <img src="./img/big_2.jpg" alt="">
            <img src="./img/big_3.jpg" alt="">
            <img src="./img/big_4.jpg" alt="">
            <img src="./img/big_5.jpg" alt="">
            <img src="./img/big_6.jpg" alt="">
            <img src="./img/big_7.jpg" alt="">
            <img src="./img/big_8.jpg" alt="">
            <img src="./img/big_9.jpg" alt="">
            <img src="./img/big_10.jpg" alt="">
            <img src="./img/big_11.jpg" alt="">
        </div>
        <div class="xiaotu">
            <img src="./img/small_1.jpg" alt="">
            <img src="./img/small_2.jpg" alt="">
            <img src="./img/small_3.jpg" alt="">
            <img src="./img/small_4.jpg" alt="">
            <img src="./img/small_5.jpg" alt="">
            <img src="./img/small_6.jpg" alt="">
            <img src="./img/small_7.jpg" alt="">
            <img src="./img/small_8.jpg" alt="">
            <img src="./img/small_9.jpg" alt="">
            <img src="./img/small_10.jpg" alt="">
            <img src="./img/small_11.jpg" alt="">
        </div>
    </div>
    <script src="./jquery.js"></script>
</body>

</html>
<script>
    
    var img1 = $('.xiaotu img');
    var img2 = $('.datu img');
    //index:
    // img1.each(function(index){
    //     img1.eq(index).hover(function(){
    //     img2.eq(index).show()
    //         .siblings().hide()
    // })
    // });
    
    //this:
    img1.hover(function(){
        img2.eq($(this).index()).show()
            .siblings().hide()
    })





    // var datu = document.querySelector('.datu img');
    // var tupian = document.querySelectorAll('img');
    // for (var i = 0; i < tupian.length; i++) {
    //     tupian[i].index = i;
    //     tupian[i].onmouseover = function () {
    //         datu.src = '../img/big_' + this.index + '.jpg';
    //     }
    // }
    // datu.onmouseover = function () {
    //     datu.src = "../img/big_1.jpg";
    // }

</script>